package weeklearn02;

import java.util.Arrays;
import java.util.Scanner;

class Circle{
	
	private double radius;
	
	public Circle(double radius){
		this.radius = radius;
	}
	
	public double getPerimeter(Circle c){
		return (double) (c.radius*2*Math.PI);
	}
	
	public double getArea(Circle c){
		return (double) (Math.PI*c.radius*c.radius);
	}

	@Override
	public String toString() {
		return "Circle [radius=" + radius + "]";
	}
	
}

class Rectangle{
	
	private double width;
	private double length;
	
	public Rectangle(double width, double length){
		this.width = width;
		this.length = length;
	}
	
	public Rectangle() {
		// TODO Auto-generated constructor stub
	}

	public double getPerimeter(Rectangle r){
		return (double) (r.length*2+r.width*2);
	}
	
	public double getArea(Rectangle r){
		return (double) (r.length*r.width);
	}

	@Override
	public String toString() {
		return "Rectangle [width=" + width + ", length=" + length + "]";
	}
	
	
}

class Triangle{
	private double height;
	private double bian1;
	private double bian2;
	private double di;
	
	public Triangle(double height, double bian1, double bian2, double di){
		this.height = height;
		this.bian1 = bian1;
		this.bian2 = bian2;
		this.di = di;
	}
	
	public double getPerimeter(Triangle r){
		return (double) (r.bian1+r.bian2+r.di);
	}
	
	public double getArea(Triangle r){
		return (double) (r.height*r.di)/2;
	}
}

public class TestShape{

	
	
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		Rectangle[] r = new Rectangle[2]; 
		r[0] = new Rectangle(sc.nextDouble(), sc.nextDouble());
		r[1] = new Rectangle(sc.nextDouble(), sc.nextDouble());
		Circle[] c = new Circle[2];
		c[0] = new Circle(sc.nextDouble());
		c[1] = new Circle(sc.nextDouble());
		Triangle[] t = new Triangle[2];
		t[0] = new Triangle(sc.nextDouble(), sc.nextDouble(), sc.nextDouble(), sc.nextDouble());
		t[1] = new Triangle(sc.nextDouble(), sc.nextDouble(), sc.nextDouble(), sc.nextDouble());
		System.out.println(r[0].getPerimeter(r[0])+r[1].getPerimeter(r[1])+c[0].getPerimeter(c[0])+c[1].getPerimeter(c[1])+t[1].getPerimeter(t[1])+t[0].getPerimeter(t[0]));
		System.out.println(r[0].getArea(r[0])+r[1].getArea(r[1])+c[0].getArea(c[0])+c[1].getArea(c[1])+t[0].getArea(t[0])+t[1].getArea(t[1]));
		sc.close();
	}
//[Circle [radius=7], Circle [radius=1]]
}
